#ifndef __CONFIG_H
#define __CONFIG_H
#include "usr_def.h"

struct config_list{
    uint8_t flag;
    uint8_t rfAddr[5];
    uint8_t rfChannel;
    uint8_t testFlag1;
    uint8_t testFlag2;
    int16_t rcMax[4];
    int16_t rcMin[4];
    int16_t rcMid[4];
    uint8_t crc;
};
extern struct config_list config_list;

#define TEST_FLAG_CALIBRATED 0X07
#define TEST_FLAG_RF_TESTED 0X10

void config_save_all();
void config_load_all();
// void config_test();
uint8_t EEPROM_read(uint16_t addr);
void EEPROM_clean(uint16_t addr);
void eeprom_write_data(uint8_t addr, uint8_t *d, uint16_t len);
void eeprom_read_data(uint8_t addr, uint8_t *d, uint16_t len);

#endif // !__CONFIG_H